<%@ Import namespace="MIMS_WRS.Web" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="BOList.aspx.vb" Inherits="MIMS_WRS.Web.BOList" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>
			<asp:literal runat="server" id="ltrHeader"></asp:literal></title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<LINK href="bulkorderlist.css" type="text/css" rel="stylesheet" name="Default stylesheet">
		<LINK href="common.css" type="text/css" rel="stylesheet" name="Default stylesheet">
		<script language="JavaScript" src="../js/list.js"></script>
		<script language="javascript">						
		
			var currentIdx = -1;
			var ie = document.all;		
			var currentPos = <%=CurrentScrollPos%>;				
			var sup = '<%=RequestContext.SupplierCode%>';
			var boType = '<%=RequestContext.BulkOrderType%>';
			var sort = '<%=RequestContext.BOSortType%>';
			
			function updateHeight() {
				var h = window.document.getElementById('actionTop').offsetHeight;				
				scaleHeightToBrowser('divOuter', h, 100);
			}
			
			if (window.attachEvent)
				window.attachEvent("onresize", updateHeight);
			else if (window.addEventListener)
				window.addEventListener("resize", updateHeight, false);	
		
			function printDocument() {
				window.document.getElementById('actionTop').style.display = "none";
				window.document.getElementById('ActionBottom').style.display = "none";
				window.print();
				window.document.getElementById('actionTop').style.display = "block";
				window.document.getElementById('ActionBottom').style.display = "block";
			}
										
			function initTable() {
				tbl = window.document.getElementById('tblList');				
				tbody = tbl.getElementsByTagName('TBODY');				
				tbody = tbody[0];			
				
				for (i=0; i<tbody.rows.length; i++) {
					//tbody.rows[i].onclick = rowOnClick;
					tbody.rows[i].ondblclick = rowDoubleClick;					
					tbody.rows[i].orgClassName = tbody.rows[i].className;					
					/* highlight records (refer to code behind also)	*/					
					if (tbody.rows[i].cells[17].childNodes[0].childNodes[0].childNodes[0].childNodes[0] != null)
					{																					
						tbody.rows[i].cells[17].style["backgroundColor"] = "red";
					}
					/* Make a rule that when all "Ordered Units" = "Completed" = "Qty Shipped Units" 
						then "Comp. Date" field backgroung goes a colout say purple ! */
					if (tbody.rows[i].cells[34].childNodes[0].childNodes[0].childNodes[0].childNodes[0] != null)
					{
						tbody.rows[i].cells[34].style["backgroundColor"] = "#ae00da";
					}
				}					
			}
			
			function rowDoubleClick() {
				var id = this.cells[0].childNodes[0].value;
				openDialog(id, id + ",");
			}
			
			function selectOne(row, ctrl) {
				if (ctrl) {
					if (row.cells[0].childNodes[1].value == "0") {
						row.className = "tableRowSelected";						
						row.cells[0].childNodes[1].value = "1";
						row.cells[0].childNodes[2].checked = true;
					}
					else {											
						row.className = row.orgClassName;					
						row.cells[0].childNodes[1].value = "0";
						row.cells[0].childNodes[2].checked = false;
					}
				}
				else {
					var tbody = row.parentNode;						
					for (i=0; i<tbody.rows.length; i++) {						
						tbody.rows[i].cells[0].childNodes[1].value = "0";
						tbody.rows[i].cells[0].childNodes[2].checked = false;
						if (tbody.rows[i] != row) {							
							tbody.rows[i].className = tbody.rows[i].orgClassName;							
						}
					}					
					row.cells[0].childNodes[1].value = "1";		
					row.cells[0].childNodes[2].checked = true;								
					row.className = "tableRowSelected";
				}								
			}
			
			function selectMulti(row) {
				var tbl = row.parentNode.parentNode;
				var from, to;
				if (row.rowIndex >= currentIdx) {
					from = currentIdx;
					to = row.rowIndex;				
				} else {
					from = row.rowIndex;
					to = currentIdx;					
				}				
				for (i=from; i<=to; i++) {					
					tbl.rows[i].className = "tableRowSelected";
					tbl.rows[i].cells[0].childNodes[1].value = "1";					
					tbl.rows[i].cells[0].childNodes[2].checked = true;
				}
			}
			
			function getTBODY() {
				var tbl = window.document.getElementById('tblList');
				var tbody = tbl.getElementsByTagName('TBODY');
				return tbody[0];
			}
			
			function selectAll() {				
				var tbody = getTBODY();				
				for (i=0; i<tbody.rows.length; i++) {
					tbody.rows[i].className = "tableRowSelected";
					tbody.rows[i].cells[0].childNodes[1].value = "1";					
					tbody.rows[i].cells[0].childNodes[2].checked = true;						
				}		
				return false;
			}
			
			function deSelectAll() {
				var tbody = getTBODY();
				for (i=0; i<tbody.rows.length; i++) {
					tbody.rows[i].className = tbl.rows[i].orgClassName;
					tbody.rows[i].cells[0].childNodes[1].value = "0";					
					tbody.rows[i].cells[0].childNodes[2].checked = false;						
				}	
				return false;	
			}
			
			function rowOnClick(e) {
				var isCtrl = ie?event.ctrlKey:e.ctrlKey;
				var isShift = ie?event.shiftKey:e.shiftKey;
								
				if (isShift) {
					if (currentIdx > -1)
						selectMulti(this);
				}
				else
					selectOne(this, isCtrl);
					
				if (ie)
					event.returnValue = false;
				else
					e.returnValue = false;
				
				//if (currentIdx > -1) this.parentNode.parentNode.rows[currentIdx].cells[0].className = "";
				currentIdx = this.rowIndex;					
				//this.cells[0].className = "SelectedRowIndicated";
			}			
			
			function newBO() {
				openDialog(0, "");
				return false;
			}
			
			function exportExcel() {
				if (checkSelected()) {
					var ids = "";
					for (i=0; i<tbody.rows.length; i++) {
						var id = tbody.rows[i].cells[0].childNodes[0].value;
						var checked = tbody.rows[i].cells[0].childNodes[1].value;
						if (checked == "1") {							
							ids += id + ",";
						}						
					}							
					var strIds = "../Excel/BulkOrderExcel.aspx?ids=" + ids + "&botype=" + boType;
					window.open(strIds, "_blank", "menubar=0;location=0;toolbar=0;resizable=1;");		
				}
				return false;
			}
			
			function editMulti() {
				if (checkSelected()) {
					var ids = "";
					var firstId = "";
					for (i=0; i<tbody.rows.length; i++) {
						var id = tbody.rows[i].cells[0].childNodes[0].value;
						var checked = tbody.rows[i].cells[0].childNodes[1].value;
						if (checked == "1") {							
							ids += id + ",";
							if (firstId == "")
								firstId = id;							
						}						
					}							
					openDialog(firstId, ids);
				}
				return false;
			}
			
			function openDialog(id, ids, tabid) {				
				var url = "BODetail.aspx";
				if (tabid != null && tabid != 'undefined' && tabid == 1) 
					url = 'DOList.aspx';										 							
				url = url + '?sup=' + sup + '&id=' + id + '&ids=' + ids;			
				if (tabid != null && tabid != 'undefined' && tabid == 1)
					url = url + '&tabid=' + tabid;				
				var height = 710;
				var width = 1010;//950;
				var iTop = (screen.height-height-30)/2;
				//var iLeft = (screen.width-width)/2;						
				var iLeft = 20;
				window.open(url, '', 'top=' + iTop + ',left=' + iLeft + ',height=' + height + ',width=' + width +',status=yes,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no');				
			}
			
			function checkSelected() {
				var tbl = window.document.getElementById('tblList');
				var tbody = tbl.getElementsByTagName('TBODY');
				tbody = tbody[0];
				var found = false;
				for (i=0; i<tbody.rows.length; i++) {
					if (tbody.rows[i].cells[0].childNodes[1].value == "1") {
						found = true;
						break;
					}						
				}				
				if (found)
					return true;
				else {
					alert('Please select items to process');
					return false;
				}
			}
		
			function deleteClick() {				
				return checkSelected() && confirm('Are you sure you want to delete?');
			}
						
			function markCompletedClick() {				
				return checkSelected() && confirm('Are you sure you want to mark completed selected item(s)?');
			}
			
			function tickClick() {
				return checkSelected() && confirm('Are you sure you want to target selected item(s)?');
			}
			
			function unTickClick() {
				return checkSelected() && confirm('Are you sure you want to un-target selected item(s)?');
			}
			
			function markArchiveClick() {				
				return checkSelected() && confirm('Are you sure you want to archive selected item(s)?');
			}
			
			function markUnArchiveClick() {				
				return checkSelected() && confirm('Are you sure you want to un-archive selected item(s)?');
			}
				
			function getListUrl(_sort) {
				var pos = window.document.getElementById('txtScrollPos').value;		
				var conPointID = window.document.getElementById('txtConPoint').value;			
			
				return "BulkOrderList.aspx?sup=" + sup + "&pos=" + pos + "&botype=" + boType + "&sort=" + _sort + '&conPointID=' + conPointID;
			}
			function window_onload() {							
				window.document.getElementById('divOuter').scrollTop = currentPos;
				//window.document.getElementById('<%= btnDelete.ClientID %>').onclick = deleteClick;
			}
			function setScrollPost() {
				window.document.getElementById('txtScrollPos').value=window.document.getElementById('divOuter').scrollTop;
			}
			
			function sortBy(_sort) {
				window.location.href = getListUrl(_sort);
				return false;
			}
			
			function openTerritoryDialog(id,productCode) {
				var url = '../Offices/BOTerritoryEdit.aspx?id=' + id + '&secondValue=' + productCode;
				var title = escape('HD - Territories Prices 1.5');
				var height = 200;
				var width = 550;
				var iTop = (screen.height-height-30)/2;
				var iLeft = (screen.width-width)-40;		
				
				window.showModalDialog('../Dialogs/ShowDialog.aspx?title=' + title + '&src=' + url, '', 'dialogLeft: ' +iLeft+ 'px; dialogTop:' + iTop+ 'px; dialogHeight: ' + height + 'px; dialogWidth: ' + width + 'px; center: no; resizable: no; scroll: no; status: no;');
			}
		</script>
	</HEAD>
	<body onresize="setScrollPost()">
		<form id="form1" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"
			runat="server">
			<div id="actionTop">
				<div id="navigation"></div>
				<div id="title">
					<h5><% if RequestContext.BulkOrderType=0 then %>Incomplete
						<% else if RequestContext.BulkOrderType=1 then %>
							Completed
						<% else %>
							Archived
						<%end if%>
						Bulk Order Scheduler - 
						<asp:dropdownlist id="ddlConPoint" runat="server" onchange="conPointchanged('')"></asp:dropdownlist>&nbsp;<span id="divSupplier"></span>&nbsp;<asp:linkbutton id="lnkSwitchOffice" runat="server">switch</asp:linkbutton>
						Supplier:
						<asp:literal id="ltrSupplierName" runat="server"></asp:literal>
						<%=RequestContext.SupplierCode%>
					</h5>
				</div>
				<div id="sort">Sort by:&nbsp;<A onclick="javascript:return sortBy(<%= EBOSorting.Type %>);" href="javascript:;" >Type 
						- Owner - Product Code</A>&nbsp;|&nbsp;<A onclick="javascript:return sortBy(<%= EBOSorting.Owner %>);" href="javascript:;" >Owner 
						- Product code</A>&nbsp;|&nbsp;<A onclick="javascript:return sortBy(<%= EBOSorting.ProductCode %>);" href="javascript:;" >Product 
						Code - Owner</A>&nbsp;|&nbsp;<A onclick="javascript:return sortBy(<%= EBOSorting.OwnerBONo %>);" href="javascript:;" >Owner - BO No - Product code</a><br>
					Current Sorting:&nbsp;<asp:label id="lblSorting" runat="server" EnableViewState="False" cssclass="CurrentSort">Requisition No. - Primary</asp:label>
				</div>
				<div id="actionButtons"><input onclick="return newBO();" type="image" alt="Add new" src="../images/add.gif"><input onclick="return editMulti();" type="image" alt="Edit" src="../images/edit2.gif"><asp:imagebutton id="btnDelete" ImageUrl="../images/delete.gif" AlternateText="Delete" CausesValidation="False"
						Runat="server"></asp:imagebutton><asp:imagebutton id="btnMarkCompleted" ImageUrl="../images/markcompleted.gif" AlternateText="Mark completed"
						CausesValidation="False" Runat="server"></asp:imagebutton>&nbsp;<asp:imagebutton id="btnTick" ImageUrl="../images/tick.gif" AlternateText="Target item" CausesValidation="False"
						Runat="server"></asp:imagebutton><asp:imagebutton id="btnUnTick" ImageUrl="../images/untick.gif" AlternateText="Un-target item" CausesValidation="False"
						Runat="server"></asp:imagebutton>&nbsp;<asp:imagebutton Width="24" Height="24" id="btnArchived" ImageUrl="../images/archived.gif" AlternateText="Archive item" CausesValidation="False"
						Runat="server"></asp:imagebutton><asp:imagebutton id="btnUnArchived" width="24" height="24" ImageUrl="../images/unarchived.gif" AlternateText="Un-archive item" CausesValidation="False"
						Runat="server"></asp:imagebutton> &nbsp;<input type="image" onclick="return exportExcel();" alt="Exports all fields for selected records to Excel" src="../images/excel.gif">
				</div>
				&nbsp;.::.&nbsp;			
				<a href="javascript:void(0)" onclick="return selectAll();">select all</a>
				<a href="javascript:void(0)" onclick="return deSelectAll();">deselect all</a>
				<div id="legend">
					Column Indicators:
					<span class="All">All</span>&nbsp;&nbsp;<span class="Office">Office</span>&nbsp;&nbsp;<span class="Factory">Factory</span>&nbsp;&nbsp;&nbsp;&nbsp;Row 
					Indicators:&nbsp;<span class="ThisWeek">Modified this week</span>&nbsp;&nbsp;<span class="LastWeek">Modified last week</span>&nbsp;&nbsp;Older 
					items
				</div>
			</div>
			
			<div id="divOuter" onscroll="setScrollPost()"><asp:repeater id="rptList" runat="server" enableviewstate="False">
					<headertemplate>
						<table id="tblList">
							<thead>
								<tr>
									<th rowspan="3" width="1px">
									</th>
									<th rowspan="3" class="OwnerCell Factory">
										Owner
									</th>
									<th rowspan="3" class="BONoCell Factory">
										BO No
									</th>
									<th rowspan="3" class="CatalogueCell Factory">
										Catalogue</th>
									<th rowspan="3" class="PageCell Factory">
										Page</th>
									<th rowspan="3" class="OrderDateCell Factory" title="Date when the order was made by office">
										Order Date<img src="../images/down.gif"></th>
									<th rowspan="3" class="TypeCell Factory" title="An order can be ordered by offices (Ordered) or can be created by manufacturer (Stock)">
										Type<% If (RequestContext.BOSortType = EBOSorting.Type) Then %><img src="../images/down.gif"><% End If %></th>
									<th rowspan="3" class="ProductCodeCell Factory" title="Product code of the order">
										Product Code<img src="../images/down.gif"></th>
									<th rowspan="3" class="DescriptionCell Factory" title="Description of the order">
										Description</th>
									<th rowspan="3" class="ColorCell Factory" title="Color of the product">
										Color</th>
									<th rowspan="3" class="StartDateCell Factory" title="Date when the production started">
										Start date</th>
									<th rowspan="3" class="OrderedCell Factory" title="Total quantity of the product that has been ordered">
										Ordered Units</th>
									<th rowspan="3" class="PackCell Factory">
										Unit Desc.</th>
																
									<th colspan="3" class="WorkinprogressCell Factory" title="">
										Work in progress</th>
									<th rowspan="3" class="NotStartedCell Factory" title="Total quantity of the product that has not started yet">
										Units Not Started</th>
									<th rowspan="3" class="EstimatedDateCell Factory" title="Estimated date when 100% ordered quantity completed">
										Estimated Complete Date</th>
									<th rowspan="3" class="QtyAvailCell Factory" title="Quantity available for purchase orders (PO)">
										Qty Avail. Units</th>
									<!--
									<th rowspan="3" class="QtyAvailCell Factory" title="Adjusted quantity for purchase orders (PO)">
										Qty Avail. Units Adjusted</th>	
									-->																											
									<th rowspan="3" class="QtyShippedCell Factory" >
										Qty Shipped Units</th> 
									<th rowspan="3" class="QtyNotShippedCell Factory" >
										Qty Not Shipped Units</th> 
									<th rowspan="3" class="ActualStockCell Factory" >
										Actual Stock Units</th> 
									<th rowspan="3" class="StockLocCell Factory" title="">
										Loc.</th>
									<th rowspan="3" class="DateStockCheckCell Factory" title="The last time when stock was checked">
										Date Stock Last Checked</th>
									<th rowspan="3" class="StockQtyCell Factory" title="The quantity of the last checked time">
										Stock Qty Inspected</th>
									
									<th rowspan="3" class="HD15PCell Factory">
										LGD Cat</th>
									<th rowspan="3" class="PackQtyCell Factory">
										LGD Catalog Pack Qty</th>		
									<th rowspan="3" class="CatPackDescCell Factory">
										LGD Catalog Pack Desc</th>		
									<th rowspan="3" class="QtyAvailCatCell Factory" >
										Qty Avail. LGD Catalog Pack</th> 	
									<th rowspan="3" class="MUKCatPackQtyCell Factory" >
										MUK/THG Catalog Pack Qty</th> 
									<th rowspan="3" class="MUKCatPackDescCell Factory" >
										MUK/THG Catalog Pack Desc.</th> 	
									<th rowspan="3" class="PackQtyCell Factory" title="report 'Qty Avail. Units' divided by 'MUK/THG Catalog Pack Qty'">
										Qty Avail. MUK/THG Catalog Pack</th> 	
									<th rowspan="3" class="OperaQtyCell Factory" title="">
										MUK/THG Opera Qty</th>
									
									<th rowspan="3" class="FOBCell Factory" title="Current FOB price of the product per unit">
										Outer FOB 1.5 Price (USD)</th>
									<th rowspan="3" class="FOBCell Factory">
										Units per Outer</th>
									<th rowspan="3" class="FOBCell Factory">Unit FOB 1.5 Price (USD)</th>
									<th rowspan="3" class="CompletedDateCell Factory" title="Date when the bulk order was completed">
										Comp. Date</th>
									<th rowspan="3" class="SalesDesc1Cell Office" title="Sales description 1">
										Sales Description 1</th>
										<th rowspan="3" class="SalesDesc2Cell Office" title="Sales description 2">
										Sales Description 2</th>
									<th rowspan="3" class="MinOrderQtyCell Office" title="Minimum order quantity">
										Minimum Order Qty</th>
								    <th rowspan="3" class="MinOrderQtyCell Office" title="Minimum quantity volume">
										Min Qty Volume</th>
									<th rowspan="3" class="MinOrderQtyCell Office" title="Tall pallet quantity">
										Tall Pallet Qty</th>
									<th rowspan="3" class="HD15PCell Office" title="Home Delivered 1.5 Price">
										HD</th>
									<th rowspan="3" class="UnitWidth Factory" title="Qty Units per 40' container">
										 Units/40'</th>	
									<th rowspan="3" class="UnitWidth Factory" title="Qty Units per 20' container">
										 Units/20'</th>
									<th rowspan="3" class="UnitWidth Factory" title="Unit weight (kg)">
										 Unit weight (kg)</th>
									<th rowspan="3" class="UnitWidth Factory" title="Harm'zed Code">
										 Harm'zed Code</th>
									<th rowspan="3" class="FOBCell Office" title="Special Offer Discount %">
										Special Offer Disc.%</th>
									<th rowspan="3" class="IDSSortCell Office" title="IDS Sort Order">
										IDS Sort Order</th>
									<th rowspan="3" class="TargetCell Office" title="Target">
										Target</th>
										<th rowspan="3" class="NaUSACell Office" title="Not avail in USA">
										n/a.US</th>
								</tr>
								<tr>
									<th rowspan="2" class="CompletedCell Factory" title="Total quantity of the product that has been completed">
										Completed</th>
									<th colspan="2" class="QtyInprogressCell Factory" title="">
										Qty In progress</th></tr>
								<tr>
									<th class="Below50Cell Factory" title="Total quantity of the product which has been below 50% completed">
										Below 50%</th>
									<th class="Above50Cell Factory" title="Total quantity of the product which has been completed from 50% to less than 100%">
										Above 50%</th></tr>
							</thead>
							<tbody>
					</headertemplate>
					<itemtemplate>
						<tr class="<%# GetRowClass(Container) %>">
							<td><input type="hidden" id="hidID" value='<%# DataBinder.Eval(Container.DataItem, "BulkOrderID") %>'><input type="hidden" id="chkStatus" value="0"><input id=chkSelect name=chkSelect type=checkbox style="visibility: hidden;display: none" value='<%# DataBinder.Eval(Container.DataItem, "BulkOrderID") %>'>
							</td>
							<td><div class="OwnerCell <%# GetModifiedClass(Container) %>"><span><%# GetOwnerText(DataBinder.Eval(Container.DataItem, "Owner")) %></span></div>
							</td>
							<td><div class="BONoCell <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "BONo")) %></span></div>
							</td>
							<td><div class="CatalogueCell <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "Catalogue"))%></span></div>
							</td>
							<td><div class="PageCell <%# GetModifiedClass(Container) %>"><%# GetNormalText(DataBinder.Eval(Container.DataItem, "Page"))%></div>
							</td>
							<td><div class="OrderDateCell DateType <%# GetModifiedClass(Container) %>"><span><%# GetDateText(DataBinder.Eval(Container.DataItem, "OrderDate"))%></span></div>
							</td>
							<td><div class="TypeCell <%# GetModifiedClass(Container) %>"><span><%# GetTypeText(DataBinder.Eval(Container.DataItem, "Type")) %></span></div>
							</td>
							<td><div class="ProductCodeCell <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "ProductCode"))%></span></div>
							</td>
							<td><div class="DescriptionCell <%# GetModifiedClass(Container) %>" title="<%# GetNormalText(DataBinder.Eval(Container.DataItem, "Description"))%>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "Description"))%></span></div>
							</td>
							<td><div class="ColorCell <%# GetModifiedClass(Container) %>" title="<%# GetNormalText(DataBinder.Eval(Container.DataItem, "Color"))%>" ><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "Color"))%></span></div>
							</td>
							<td><div class="StartDateCell DateType <%# GetModifiedClass(Container) %>"><span><%# GetDateText(DataBinder.Eval(Container.DataItem, "StartDate"))%></span></div>
							</td>
							<td><div class="OrderedCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetOrderedText(Container)%></span></div>
							</td>
							<td><div class="PackCell <%# GetModifiedClass(Container) %>"><span><%# GetPackTypeText(DataBinder.Eval(Container.DataItem, "Pack")) %></span></div>
							</td>	
																		
							<td><div class="CompletedCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "TotalQtyCompleted"))%></span></div>
							</td>
							<td><div class="Below50Cell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "TotalQtyInProgressBelow50P"))%></span></div>
							</td>
							<td><div class="Above50Cell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "TotalQtyInProgressAbove50P"))%></span></div>
							</td>
							<td><div class="NotStartedCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetUnitsNotStartedHTML(Container)%></span></div>
							</td>
							<td><div class="EstimatedDateCell DateType <%# GetModifiedClass(Container) %>"><span><%# GetEstimatedDateHTML(Container)%></span></div>
							</td>
							<td><div class="QtyAvailCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetQtyAvailHTML(DataBinder.Eval(Container.DataItem, "QuantityAvailable"), Container)%></span></div>
							</td>
							
							<td><div class="QtyShippedCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "QuantityShipped"))%></span></div>
							</td>
							<td><div class="QtyNotShippedCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "QuantityNotShipped"))%></span></div>
							</td>
							<td><div class="ActualStockCell NumericType"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "ActualStock"))%></span></div>
							</td>
							
							<td><div class="StockLocCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "StockLocation"))%></span></div>
							</td>
							<td><div class="DateStockCheckCell DateType <%# GetModifiedClass(Container) %>"><span><%# GetDateText(DataBinder.Eval(Container.DataItem, "StockLastCheckedDate"))%></span></div>
							</td>
							<td><div class="StockQtyCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "StockLastCheckedQty"))%></span></div>
							</td>
							
							<td><div class="HD15PCell DateType <%# GetModifiedClass(Container) %>"><span><%# GetLGDCatText(DataBinder.Eval(Container.DataItem, "IsShownInLGDCatalog"))%></span></div>
							</td>	
							
							<td><div class="PackQtyCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "PackQty"))%></span></div>
							</td>	
							<td><div class="CatPackDescCell <%# GetModifiedClass(Container) %>"><span><%# GetPackType2Text(DataBinder.Eval(Container.DataItem, "CatPackDesc")) %></span></div>
							</td>
							<td><div class="QtyAvailCatCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetQtyAvailCatalogHTML(Container)%></span></div>
							</td>
							<td><div class="MUKCatPackQtyCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "MUKTHGCatPackQty"))%></span></div>
							</td>
							<td><div class="MUKCatPackDescCell <%# GetModifiedClass(Container) %>"><span><%# GetPackType2Text(DataBinder.Eval(Container.DataItem, "MUKTHGCatPackDesc"))%></span></div>
							</td>
							<td><div class="QtyAvailCatCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetQtyAvailMUKTHGCatalogPackHTML(Container)%></span></div>
							</td>
							
							<td><div class="OperaQtyCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetOperaQtyText(Container)%></span></div>
							</td>
							
							<td><div class="FOBCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetDecimalText(DataBinder.Eval(Container.DataItem, "FOB")) %></span></div>
							</td>
							<td><div class="FOBCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNumericText(DataBinder.Eval(Container.DataItem, "UnitsPerOuter")) %></span></div>
							</td>
							<td><div class="FOBCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetDecimalText(DataBinder.Eval(Container.DataItem, "UnitFOBPrice")) %></span></div>
							</td>
							
							<td><div class="CompletedDateCell DateType <%# GetModifiedClass(Container) %>"><span><%# GetCompletedDateHTML(Container)%></span></div>
							</td>
							<td><div class="SalesDesc1Cell <%# GetModifiedClass(Container) %>" title="<%# GetNormalText(DataBinder.Eval(Container.DataItem, "SalesDescription1"))%>" ><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "SalesDescription1"))%></span></div></td>
							<td><div class="SalesDesc2Cell <%# GetModifiedClass(Container) %>" title="<%# GetNormalText(DataBinder.Eval(Container.DataItem, "SalesDescription2"))%>" ><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "SalesDescription2"))%></span></div></td>
							<td><div class="MinOrderQtyCell NumericType <%# GetModifiedClass(Container) %>" title="<%# GetNormalText(DataBinder.Eval(Container.DataItem, "MinOrderQtyValue"))%> <%# GetNormalText(DataBinder.Eval(Container.DataItem, "MinOrderQty"))%>" ><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "MinOrderQtyValue"))%> <%# GetNormalText(DataBinder.Eval(Container.DataItem, "MinOrderQty"))%></span></div></td>
							<td><div class="MinOrderQtyCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetDecimalTextEx4(DataBinder.Eval(Container.DataItem, "MinQtyVolume"))%></span></div></td>
							<td><div class="MinOrderQtyCell NumericType <%# GetModifiedClass(Container) %>" title="<%# GetNormalText(DataBinder.Eval(Container.DataItem, "TallPaletQty"))%>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "TallPaletQty"))%></span></div></td>
							<td><div class="HD15PCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetHomeDeliveredHTML(Container) %></span></div>
							</td>
							
							<td><div class="UnitWidth NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNumericText(DataBinder.Eval(Container.DataItem, "QtyUnitsPer40Cont"))%></span></div></td>
							<td><div class="UnitWidth NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNumericText(DataBinder.Eval(Container.DataItem, "QtyUnitsPer20Cont"))%></span></div></td>
							<td><div class="UnitWidth NumericType <%# GetModifiedClass(Container) %>"><span><%# GetDecimalTextForUnitWeight(DataBinder.Eval(Container.DataItem, "UnitWeight"))%></span></div></td>
							<td><div class="UnitWidth NumericType <%# GetModifiedClass(Container) %>"><span><%# GetHarmzedCodeHTML(Container)%></span></div></td>
							
							<td><div class="FOBCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetDecimalText(DataBinder.Eval(Container.DataItem, "SpecialOfferDisc")) %></span></div>
							</td>
							<td><div class="IDSSortCell NumericType <%# GetModifiedClass(Container) %>"><span><%# GetNormalText(DataBinder.Eval(Container.DataItem, "IDSSortOrder"))%></span></div></td>
							<td><div class="TargetCell <%# GetModifiedClass(Container) %>" align=center><%# GetTargetHTML(DataBinder.Eval(Container.DataItem, "Target"))%></div></td>
							<td><div class="NaUSACell <%# GetModifiedClass(Container) %>" align=center><%# GetNaUSAHTML(DataBinder.Eval(Container.DataItem, "AvailableInUSA"))%></div></td>
						</tr>
					</itemtemplate>
					<footertemplate>
						</tbody></table>
					</footertemplate>
				</asp:repeater></div>
			<script language="javascript">
			<!--												
				setTimeout("updateHeight()", 100);
				
				setTimeout("initTable()", 100);							
				
				function disabletext(e){
					return false;
				}

				function reEnable(){
					return true;
				}
				
				function selectStart() {
					return false;
				}				
				if (ie)	
					document.onselectstart = selectStart;
				else if (window.sidebar){
					document.onmousedown=disabletext;
					document.onclick=reEnable;
				}
								
				setTimeout("window_onload()", 100);		
						
			//-->
			</script>
			<input id="btnRefresh" style="DISPLAY: none" onclick="window.location.replace(getListUrl(sort))"
				type="button"> <input id="txtScrollPos" type="hidden"><input id="txtConPoint" type="hidden" runat="server">
		</form>
	</body>
</HTML>
